Ext.namespace('Divo');
Ext.namespace('Divo.app');

Divo.app.BusinesslicenceForm = Ext.extend(Divo.Base.EditForm, {
      fields : new Ext.util.MixedCollection(),
      dataRecordMeta : Ext.data.Record.create([{
            name : "_p_record_status",
            type : "string"
          }, {
            name : "id",
            type : "float"
          }, {
            name : "supplierId",
            type : "float"
          }, {
            name : "supplier",
            type : "string"
          }, {
            name : "copyNo",
            type : "string"
          }, {
            name : "registerNo",
            type : "string"
          }, {
            name : "address",
            type : "string"
          }, {
            name : "registerMoney",
            type : "float"
          }, {
            name : "person",
            type : "string"
          }, {
            name : "companyType",
            type : "string"
          }, {
            name : "businessRange",
            type : "string"
          }, {
            name : "setUpDate",
            type : "string"
          }, {
            name : "businessLast",
            type : "string"
          }, {
            name : "yearCheck",
            type : "string"
          }]),
      initComponent : function() {
        var me = this;
        var tn = 1;

        this.fields.add("_p_record_status", new Ext.form.Hidden({
                  name : "_p_record_status"
                }));
        this.fields.add("id", new Ext.form.Hidden({
                  name : "id",
                  dataIndex : "id",
                  insert_allowed : true,
                  update_allowed : true
                }));
        this.fields.add("supplierId", new Ext.form.Hidden({
                  name : "supplierId",
                  dataIndex : "supplierId",
                  insert_allowed : true,
                  update_allowed : true
                }));
        this.fields.add("copyNo", new app.base.TextField({
                  name : "copyNo",
                  dataIndex : "copyNo",
                  fieldLabel : "营业执照副本编号",
                  allowBlank : false,
                  labelSeparator : ":*",
                  tabIndex : tn++,
                  width : 150,
                  insert_allowed : true,
                  update_allowed : true
                }));
        this.fields.add("registerNo", new app.base.TextField({
                  name : "registerNo",
                  dataIndex : "registerNo",
                  fieldLabel : "营业执照注册号",
                  allowBlank : false,
                  labelSeparator : ":*",
                  tabIndex : tn++,
                  width : 150,
                  insert_allowed : true,
                  update_allowed : true
                }));
        this.fields.add("address", new app.base.TextField({
                  name : "address",
                  dataIndex : "address",
                  fieldLabel : "地址",
                  allowBlank : false,
                  labelSeparator : ":*",
                  tabIndex : tn++,
                  width : 150,
                  insert_allowed : true,
                  update_allowed : true
                }));
        this.fields.add("registerMoney", new app.base.NumberField({
                  name : "registerMoney",
                  dataIndex : "registerMoney",
                  fieldLabel : "注册资本",
                  allowBlank : false,
                  labelSeparator : ":*",
                  tabIndex : tn++,
                  width : 150,
                  insert_allowed : true,
                  update_allowed : true
                }));
        this.fields.add("person", new app.base.TextField({
                  name : "person",
                  dataIndex : "person",
                  fieldLabel : "法人代表",
                  allowBlank : false,
                  labelSeparator : ":*",
                  tabIndex : tn++,
                  width : 150,
                  insert_allowed : true,
                  update_allowed : true
                }));
        this.fields.add("companyType", new app.base.TextField({
                  name : "companyType",
                  dataIndex : "companyType",
                  fieldLabel : "公司类型",
                  allowBlank : false,
                  labelSeparator : ":*",
                  tabIndex : tn++,
                  width : 150,
                  insert_allowed : true,
                  update_allowed : true
                }));
        this.fields.add("businessRange", new app.base.TextField({
                  name : "businessRange",
                  dataIndex : "businessRange",
                  fieldLabel : "经营范围",
                  allowBlank : false,
                  labelSeparator : ":*",
                  tabIndex : tn++,
                  width : 150,
                  insert_allowed : true,
                  update_allowed : true
                }));
        this.fields.add("setUpDate", new app.base.DateField({
                  name : "setUpDate",
                  dataIndex : "setUpDate",
                  format : 'Y.m.d',
                  fieldLabel : "成立日期",
                  allowBlank : false,
                  labelSeparator : ":*",
                  tabIndex : tn++,
                  width : 150,
                  editable : true,
                  insert_allowed : true,
                  update_allowed : true
                }));
        this.fields.add("businessLast", new app.base.DateField({
                  name : "businessLast",
                  dataIndex : "businessLast",
                  fieldLabel : "营业期限",
                  allowBlank : false,
                  format : 'Y.m.d',
                  labelSeparator : ":*",
                  tabIndex : tn++,
                  width : 150,
                  insert_allowed : true,
                  update_allowed : true
                }));
        this.fields.add("yearCheck", new app.base.DateField({
                  name : "yearCheck",
                  dataIndex : "yearCheck",
                  fieldLabel : "年度检验",
                  allowBlank : false,
                  format : 'Y.m.d',
                  labelSeparator : ":*",
                  tabIndex : tn++,
                  width : 150,
                  insert_allowed : true,
                  update_allowed : true
                }));
        this.fields.add("supplier", new app.base.TextField({
                  name : "supplier",
                  dataIndex : "supplier",
                  fieldLabel : "供应商",
                  allowBlank : false,
                  readOnly : true,
                  labelSeparator : ":*",
                  tabIndex : tn++,
                  width : 150,
                  insert_allowed : true,
                  update_allowed : true
                }));
        Ext.apply(this, {
              items : [this.fields.get("_p_record_status"), {
                layout : "form",
                columnWidth : 1,
                labelAlign : "right",
                labelWidth : 100,
                items : [this.fields.get("id"), this.fields.get("supplierId"),
                    this.fields.get("supplier"), this.fields.get("copyNo"),
                    this.fields.get("registerNo"), this.fields.get("address"),
                    this.fields.get("registerMoney"),
                    this.fields.get("person"), this.fields.get("companyType"),
                    this.fields.get("businessRange"),
                    this.fields.get("setUpDate"),
                    this.fields.get("businessLast"),
                    this.fields.get("yearCheck")]
              }],
              border : false,
              frame : true,
              firstFocusFieldName : "copyNo"
            });

        Divo.app.BusinesslicenceForm.superclass.initComponent.apply(this,
            arguments);
      }

      ,
      onRender : function() {
        Divo.app.BusinesslicenceForm.superclass.onRender.apply(this, arguments);
      },
      newDataRecord : function() {
        return new this.dataRecordMeta({
              _p_record_status : "insert",
              id : "",
              name : "",
              sId : "",
              state : ""
            });
      }

    });
Ext.reg("Divo.app.BusinesslicenceForm", Divo.app.BusinesslicenceForm);